import type { App } from 'vue';
import { Button } from './Button';
import {
  Input,
  InputNumber,
  Layout,
  Form,
  Switch,
  Dropdown,
  Menu,
  Select,
  Table,
  Checkbox,
  Tabs,
  Collapse,
  Card,
  Tooltip,
  Row,
  Col,
  Popconfirm,
  Divider,
  Alert,
  AutoComplete,
  Cascader,
  Rate,
  Slider,
  Avatar,
  Tag,
  Space,
  Steps,
  Popover,
  Radio,
  Progress,
  Image,
  Upload,
} from 'ant-design-vue';

import { BasicHelp, BasicCaption } from '/@/components/Basic';
import { GentleAlert } from '/@/components/Gentle/Alert';
import { GentleAreaSelect } from '/@/components/Gentle/AreaSelect';
import { GentleAutoComplete } from '/@/components/Gentle/AutoComplete';
import { GentleButton } from '/@/components/Gentle/Button';
import { GentleCron } from '/@/components/Gentle/Cron';
import { GentleCascader } from '/@/components/Gentle/Cascader';
import { GentleCheckbox, GentleCheckboxSingle } from '/@/components/Gentle/Checkbox';
import { GentleColorPicker } from '/@/components/Gentle/ColorPicker';
import { GentleDatePicker, GentleDateRange, GentleTimePicker, GentleTimeRange } from '/@/components/Gentle/DatePicker';
import { GentleDivider } from '/@/components/Gentle/Divider';
import { GentleIconPicker } from '/@/components/Gentle/IconPicker';
import { GentleInput, GentleTextarea } from '/@/components/Gentle/Input';
import { GentleInputNumber } from '/@/components/Gentle/InputNumber';
import { GentleLink } from '/@/components/Gentle/Link';
import { GentleOpenData } from '/@/components/Gentle/OpenData';
import {
  GentleOrganizeSelect,
  GentleDepSelect,
  GentlePosSelect,
  GentleGroupSelect,
  GentleRoleSelect,
  GentleUserSelect,
  GentleUsersSelect,
} from '/@/components/Gentle/Organize';
import { GentleQrcode } from '/@/components/Gentle/Qrcode';
import { GentleBarcode } from '/@/components/Gentle/Barcode';
import { GentleRadio } from '/@/components/Gentle/Radio';
import { GentleSelect } from '/@/components/Gentle/Select';
import { GentleRate } from '/@/components/Gentle/Rate';
import { GentleSlider } from '/@/components/Gentle/Slider';
import { GentleSign } from '/@/components/Gentle/Sign';
import { GentleSwitch } from '/@/components/Gentle/Switch';
import { GentleText } from '/@/components/Gentle/Text';
import { GentleTreeSelect } from '/@/components/Gentle/TreeSelect';
import { GentleUploadFile, GentleUploadImg, GentleUploadImgSingle, GentleUploadBtn } from '/@/components/Gentle/Upload';
import { Tinymce } from '/@/components/Tinymce/index';
import { GentleNumberRange } from '/@/components/Gentle/NumberRange';
import { GentleRelationFormAttr } from '/@/components/Gentle/RelationFormAttr';
import { GentlePopupSelect, GentlePopupTableSelect } from '/@/components/Gentle/PopupSelect';
import { GentlePopupAttr } from '/@/components/Gentle/PopupAttr';
import { GentleCalculate } from '/@/components/Gentle/Calculate';

const GentleEditor = Tinymce;
GentleEditor.name = 'GentleEditor';
const GentleGroupTitle = BasicCaption;
GentleGroupTitle.name = 'GentleGroupTitle';

export function registerGlobComp(app: App) {
  app
    .use(Input)
    .use(InputNumber)
    .use(Button)
    .use(Layout)
    .use(Form)
    .use(Switch)
    .use(Dropdown)
    .use(Menu)
    .use(Select)
    .use(Table)
    .use(Checkbox)
    .use(Tabs)
    .use(Card)
    .use(Collapse)
    .use(Tooltip)
    .use(Row)
    .use(Col)
    .use(Popconfirm)
    .use(Popover)
    .use(Divider)
    .use(Slider)
    .use(Rate)
    .use(Alert)
    .use(AutoComplete)
    .use(Cascader)
    .use(Avatar)
    .use(Tag)
    .use(Space)
    .use(Steps)
    .use(Radio)
    .use(Progress)
    .use(Image)
    .use(Upload)
    .use(BasicHelp)
    .use(GentleAlert)
    .use(GentleRate)
    .use(GentleSlider)
    .use(GentleAreaSelect)
    .use(GentleAutoComplete)
    .use(GentleButton)
    .use(GentleCron)
    .use(GentleCascader)
    .use(GentleCheckbox)
    .use(GentleCheckboxSingle)
    .use(GentleColorPicker)
    .use(GentleDatePicker)
    .use(GentleDateRange)
    .use(GentleTimePicker)
    .use(GentleTimeRange)
    .use(GentleDivider)
    .use(GentleGroupTitle)
    .use(GentleIconPicker)
    .use(GentleInput)
    .use(GentleTextarea)
    .use(GentleInputNumber)
    .use(GentleLink)
    .use(GentleOrganizeSelect)
    .use(GentleDepSelect)
    .use(GentlePosSelect)
    .use(GentleGroupSelect)
    .use(GentleRoleSelect)
    .use(GentleUserSelect)
    .use(GentleUsersSelect)
    .use(GentleOpenData)
    .use(GentleQrcode)
    .use(GentleBarcode)
    .use(GentleRadio)
    .use(GentleSelect)
    .use(GentleSign)
    .use(GentleSwitch)
    .use(GentleText)
    .use(GentleTreeSelect)
    .use(GentleEditor)
    .use(GentleRelationFormAttr)
    .use(GentlePopupSelect)
    .use(GentlePopupTableSelect)
    .use(GentlePopupAttr)
    .use(GentleNumberRange)
    .use(GentleCalculate)
    .use(GentleUploadFile)
    .use(GentleUploadImg)
    .use(GentleUploadImgSingle)
    .use(GentleUploadBtn);
}
